<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="../rurple.css" type="text/css" />

  <title>Alg​​​​​​​​​ún comentario?</title>
</head>
<body>
<h2 class="title">5. Alg​​​​​​​​​ún comentario?</h2>

<p>Abre el primer programa que esribiste.​​​​​​​​​  </p>

<p>Ok, your program should now be displayed in the program window. Now,
remember what I told you was the most important thing to do when writing a
computer program? If not, go back to the very beginning and read again.</p>

<p>I'm waiting ...</p>

<p>Es muy importante que el programa sea f​​​​​​​​​ácil de leer para
otras personas.​​​​​​​​​  Para esto hay un truco: podemos dejar notas para
otras personas que lean el programa (no para el ordenador, ni para
Reeborg). A esas notas les llamamos​​​​​​​​​  <em>commentarios</em>.
A​​​​​​​​​ñade este texto en la primera l​​​​​​​​​ínea de tu programa:</p>

<pre>
# Mi primer programa
</pre>

<p>As​​​​​​​​​í que tu programa ahora debe estar as​​​​​​​​​í:</p>

<pre>
<span class="comment"># Mi primer programa</span>
move()
move()
turn_off()
</pre>

<p>La l​​​​​​​​​ínea que empieza con el s​​​​​​​​​ímbolo​​​​​​​​​   <tt><span
 class="comment">#</span></tt>, aparece en verde. Este s​​​​​​​​​ímbolo
indica que el resto de la l​​​​​​​​​ínea es un <em>comentario,</em>
que​​​​​​​​​ Reeborg ignorar​​​​​​​​​á.​​​​​​​​​  </p>

<h3 class="try">Your turn</h3>

<p>​​​​​​​​​ ¿Qu​​​​​​​​​é pasa si a​​​​​​​​​ñades el s​​​​​​​​​ímbolo​​​​​​​​​  # al
​​​​​​​​​  pricipio de una instrucci​​​​​​​​​ón (como move() )
Int​​​​​​​​​éntalo y prueba el programa pulsando​​​​​​​​​  ​​​​​​​​​  
<img alt="run program button" src="../../images/intro/btn_run.png" />​​​​​​​​​  .</p>

<!--==============================================-->
<hr class="line" />

<h3 class="section">Teaching Reeborg some French</h3>

<p>While the creators of Reeborg designed him so that he obeys instructions
in English, they realised that not everyone understands English. So, they
gave him the ability to easily learn a second language. For example, if we
want to tell someone to "move forward" in French, we would say "avance". We
can tell Reeborg that "avance" is a synonym of "move" simply by writing<br />
<tt>avance = move</tt>.<br />
The order here is important; the known command has to be on the right, and
the new one has to be on the left. Note that we don't have any parentheses
"<tt>()</tt>" appearing since the parentheses would tell Reeborg that we want
him to obey an instruction; here, we are simply teaching him a new word. When
we want Reeborg to follow the new instruction, we will use
<tt>avance()</tt>.</p>

<h3 class="try">Your turn</h3>

<p>Write a program with the following instructions:</p>

<pre>
avance = move
avance()
turn_off()
</pre>

<p>and save it under "avance.rur". Now, try your new program.</p>

<h3 class="suggested">Experiment!</h3>

<p>If you want, you can also teach Reeborg a synonym for <tt>turn_off</tt>.
Or, you may give synonyms in a language other than French if you prefer, even
creating your own language. Then, watch Reeborg as he obeys instructions
written in <em>your</em> language.</p>

<div class="lessons_nav">
<a href="4-errors.htm"><img alt="previous"
 src="../../images/previous.png" /> Manejando eRRoRes</a> - <a
 href="../lessons_toc.htm"><img alt="home" src="../../images/home.png" /></a>
- <a href="6-left.htm">Haciendo un giro a la izquierda <img alt="next"
 src="../../images/next.png" /></a>
</div>
</body>
</html>
